package day05;

import java.util.Arrays;
import java.util.Random;

public class Homework2 {
    public static void main(String[] args) {
        int sum = 0;
        /*
        for (int num=1;num<=100;num++){
            if (num%2==0) {
                sum = sum + num;
            }
        }
        System.out.println(sum);

         */
        for (int i = 2; i <= 100; i += 2) {
            sum += i;
        }
        System.out.println(sum);
        System.out.println("-------");

        int fac = 1;
        for (int num = 8; num >= 1; num--) {
            fac = fac * num;
        }
        System.out.println(fac);
        System.out.println("----------");

        for (int j = 1; j <= 6; j++) {
            for (int i = 1; i <= 2 * j - 1; i++) {
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("--------------");

        int[] arr = new int[10];
        Random rand = new Random();

        for (int i = 0; i < arr.length; i++) {
            arr[i] = rand.nextInt(100);
            System.out.println(arr[i]);
        }
        System.out.println("+++++++++");
        int max = arr[0];
        int min = arr[0];
        for (int i = 1;i < arr.length;i++){
            if (arr[i]>max){
                max = arr[i];
            }
            if (arr[i]<min){
                min = arr[i];
            }
        }
        System.out.println(max+","+min);
    }
}
